using System.Threading;
using Microsoft.SmallBasic.Library;

namespace SmallBasicFun
{
	public  class Launcher
	{
		public static void Start(int delayInMilliseconds, SmallBasicCallback callback)
		{
			var t = new Thread(() => RunOnce(delayInMilliseconds, callback));
			t.Start();
		}

		public static void RunOnce(int intervalInMilliseconds, SmallBasicCallback callback)
		{
			if (callback != null)
			{
				Thread.Sleep((intervalInMilliseconds));
				callback();
			}
		}
	}
}